﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using 命令.Tools;
using 模板.Tools;

namespace 命令.ViewModel
{
    public class MainViewModel : ObservableObject
    {
        public RelayCommand OpenCommand { get; set; } = new RelayCommand(() =>
        {
            MessageBox.Show("Hello,Command");
        });

        public RelayCommand OpenParamCommand { get; set; } = new RelayCommand((param) =>
        {
            MessageBox.Show(param.ToString());
        });

        /// <summary>
        /// 泛型命令
        /// </summary>
        public RelayCommand2<object> OpenTParamCommand { get; set; } = new RelayCommand2<object>((t) =>
        {
            MessageBox.Show(t.ToString());
        });


        public RelayCommand2<TextBox> MouseDownCommand { get; set; } = new RelayCommand2<TextBox>((textbox) =>
        {
            textbox.Text += DateTime.Now + " 您单击了TextBox" + "\r";
        });
    }
}
